import { INestApplication } from '@nestjs/common';
import { useMiddleware } from '@/middleware';
import useFilter from '@/filters';
import { ResponseInterceptor } from '@/interceptor';
import { ValidationPipe } from '@/pips/validation.pipe';

export function appUse(app: INestApplication) {
  useFilter(app);
  useMiddleware(app);
  app.useGlobalInterceptors(new ResponseInterceptor());
  app.useGlobalPipes(new ValidationPipe()); // 用来时验证生效
}
